/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.route.system.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author neco
 */
@Entity
@Table(name = "rps_traffic_data",  schema = "public")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RpsTrafficData.findAll", query = "SELECT r FROM RpsTrafficData r"),
    @NamedQuery(name = "RpsTrafficData.findByDataId", query = "SELECT r FROM RpsTrafficData r WHERE r.dataId = :dataId"),
    @NamedQuery(name = "RpsTrafficData.findByDataDate", query = "SELECT r FROM RpsTrafficData r WHERE r.dataDate = :dataDate"),
    @NamedQuery(name = "RpsTrafficData.findByDataTime", query = "SELECT r FROM RpsTrafficData r WHERE r.dataTime = :dataTime"),
    @NamedQuery(name = "RpsTrafficData.findByDataDensity", query = "SELECT r FROM RpsTrafficData r WHERE r.dataDensity = :dataDensity"),
    @NamedQuery(name = "RpsTrafficData.findByDataDensityDetail", query = "SELECT r FROM RpsTrafficData r WHERE r.dataDensityDetail = :dataDensityDetail")})
public class RpsTrafficData implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "data_id", nullable = false)
    private Integer dataId;
    @Column(name = "data_date")
    @Temporal(TemporalType.DATE)
    private Date dataDate;
    @Column(name = "data_time")
    @Temporal(TemporalType.TIME)
    private Date dataTime;
    @Column(name = "data_density")
    private Integer dataDensity;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "data_density_detail", precision = 17, scale = 17)
    private Double dataDensityDetail;
    @JoinColumn(name = "data_route_stations", referencedColumnName = "stations_id")
    @ManyToOne
    private RpsRouteStations dataRouteStations;

    public RpsTrafficData() {
    }

    public RpsTrafficData(Integer dataId) {
        this.dataId = dataId;
    }

    public Integer getDataId() {
        return dataId;
    }

    public void setDataId(Integer dataId) {
        this.dataId = dataId;
    }

    public Date getDataDate() {
        return dataDate;
    }

    public void setDataDate(Date dataDate) {
        this.dataDate = dataDate;
    }

    public Date getDataTime() {
        return dataTime;
    }

    public void setDataTime(Date dataTime) {
        this.dataTime = dataTime;
    }

    public Integer getDataDensity() {
        return dataDensity;
    }

    public void setDataDensity(Integer dataDensity) {
        this.dataDensity = dataDensity;
    }

    public Double getDataDensityDetail() {
        return dataDensityDetail;
    }

    public void setDataDensityDetail(Double dataDensityDetail) {
        this.dataDensityDetail = dataDensityDetail;
    }

    public RpsRouteStations getDataRouteStations() {
        return dataRouteStations;
    }

    public void setDataRouteStations(RpsRouteStations dataRouteStations) {
        this.dataRouteStations = dataRouteStations;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (dataId != null ? dataId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RpsTrafficData)) {
            return false;
        }
        RpsTrafficData other = (RpsTrafficData) object;
        if ((this.dataId == null && other.dataId != null) || (this.dataId != null && !this.dataId.equals(other.dataId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.route.system.entity.RpsTrafficData[ dataId=" + dataId + " ]";
    }
    
}
